/**
 * MonitorWorkBenchDaoImpl.java
 * Created at 2017-3-22
 * Created by xieshuang
 * Copyright (C) 2017 BROADTEXT SOFTWARE, All rights reserved.
 */
package com.broadtext.rms.monitor.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.broadtext.common.exp.DaoException;
import com.broadtext.common.repository.EntityDao;
import com.broadtext.rms.monitor.dao.IMonitorWorkBenchDao;
import com.broadtext.rms.monitor.model.PackLocationInfo;
import com.broadtext.rms.monitor.model.TtPackAlert;

/**
 * <p>ClassName: MonitorWorkBenchDaoImpl</p>
 * <p>Description: 控制员工作台dao实现类</p>
 * <p>Author: xieshuang</p>
 * <p>Date: 2017-3-22</p>
 */
@Repository("monitorWorkBenchDao")
public class MonitorWorkBenchDaoImpl extends EntityDao<TtPackAlert> implements IMonitorWorkBenchDao {
    /**
     * 
     * <p>Description: 查询客户下特定数量</p>
     * @param querySql 查询sqlId
     * @param pkId 客户主键id
     * @return num
     * @throws DaoException 异常
     */
    public long findNumByCustomerId(String querySql, String pkId) throws DaoException {
        return this.getCurrentSession().selectOne(querySql, pkId);
    }
    
    /**
     * 
     * <p>Description: 查询客户下指定数量</p>
     * @param querySql 查询sqlid
     * @param queryMap 查询条件
     * @return num
     * @throws DaoException 异常
     */
    public long findChargingNumByCustomerId(String querySql, Map<String, Object> queryMap)throws DaoException {
        return this.getCurrentSession().selectOne(querySql, queryMap);
    }
    
    /**
     * 
     * <p>Description: 电池位置信息</p>
     * @param sql 查询id
     * @param queryMap 查询条件
     * @return 结果集
     * @throws DaoException 异常
     */
    public List<PackLocationInfo> findPackLocationInfo(String sql, Map<String, Object> queryMap) throws DaoException {
        return this.getCurrentSession().selectList(sql, queryMap.get("queryParams"));
    }
}
